<script setup>
  import Add from './components/Add.vue';
  import Sub from './components/Sub.vue';

  import { useStockStore } from '@/store/stock'
  const stockStore = useStockStore()
</script>

<template>
  <div>
    <h1>根组件</h1>
    库存总数: <input
      type="number"
      v-model.lazy.number="stockStore.stock"
    > <br>
    库存总数的两倍：{{ stockStore.dblStock }}
    <hr>
    <Add />
    <hr>
    <Sub />
  </div>
</template>


<style>
  #app {
    margin: 100px auto;
    padding: 10px 5px;
    border: 1px solid #ccc;
    width: 400px;
  }
</style>